{layout name="common@common_layout/template" /}
<section class="scrollable padder">
	<div class="m-b-md">
		<h3 class="m-b-none">修改咨询者</h3>
	</div>
	<section class="panel panel-default">
		<header class="panel-heading font-bold">
			名字
		</header>
		<iframe style="display: none;" name="ifr"></iframe>
		<div class="panel-body">
			<form class="form-horizontal" target="ifr" action="{:url('consultant_module/index/commit_add_edit')}" method="post" enctype="multipart/form-data">
				<input type="hidden" name="id" value="{$consultant.id}" />
				<div class="form-group">
					<label class="col-sm-2 control-label">姓名</label>
					<div class="col-sm-10">
						<input type="text" class="form-control" name="name" value="{$consultant.name}" placeholder="请输入咨询者姓名">
					</div>
				</div>
				<div class="line line-dashed b-b line-lg pull-in"></div>
				<div class="form-group">
					<label class="col-sm-2 control-label">电话号码</label>
					<div class="col-sm-10">
						<input type="text" class="form-control" placeholder="请输入咨询者电话号码" name="phone" value="{$consultant.phone}">
					</div>
				</div>
				<div class="line line-dashed b-b line-lg pull-in"></div>
				<div class="form-group" style="clear: both;">
					<label class="col-sm-2 control-label">性别</label>
					<div class="col-sm-10">
						<div class="radio i-checks" style="float: left;">
							<label>
                            <input type="radio" name="sex" value="0" <?php echo $consultant['sex']=="1"?"checked":""?>>
                            <i></i>
                            男
                          </label>
						</div>
						<div class="radio i-checks" style="float: left; margin-left: 20px;">
							<label>
                            <input type="radio" name="sex" value="1" <?php echo $consultant['sex']=="0"?"checked":""?>>
                            <i></i>
                            女
                          </label>
						</div>
					</div>
				</div>
				<div class="line line-dashed b-b line-lg pull-in"></div>
				<div class="form-group">
					<label class="col-sm-2 control-label">学历</label>
					<div class="col-sm-10">
						<select name="education_id" class="form-control m-b">
							{volist name="education_list" id="education" empty="暂时没有数据"}
								<option {$education.id==$consultant['education_id']?"selected":""} value="{$education.id}">{$education.grade}</option>
							{/volist}
						</select>
					</div>
				</div>
				<div class="line line-dashed b-b line-lg pull-in"></div>
				<div class="form-group">
					<label class="col-sm-2 control-label">学校</label>
					<div class="col-sm-10">
						<input type="text" class="form-control" placeholder="请输入咨询者就读的学校" name="school" value="{$consultant.school}">
					</div>
				</div>
				<div class="line line-dashed b-b line-lg pull-in"></div>
				<div class="form-group">
					<label class="col-sm-2 control-label">微信</label>
					<div class="col-sm-10">
						<input type="text" class="form-control" placeholder="请输入咨询者微信" name="wechat" value="{$consultant.wechat}">
					</div>
				</div>
				<div class="line line-dashed b-b line-lg pull-in"></div>
				<div class="form-group">
					<label class="col-sm-2 control-label">QQ</label>
					<div class="col-sm-10">
						<input type="text" class="form-control" placeholder="请输入咨询者手机QQ" name="qq" value="{$consultant.qq}">
					</div>
				</div>
				<div class="line line-dashed b-b line-lg pull-in"></div>
				<div class="form-group">
					<label class="col-sm-2 control-label">应聘职位</label>
					<div class="col-sm-10">
						<select name="position" class="form-control m-b">
							{volist name="position_list" id="position" empty="暂时没有数据"}
							<option {$position.id==$consultant['position']?"selected":""} value="{$position.id}">{$position.name}</option>
							{/volist}	
						</select>
					</div>
				</div>
				<div class="line line-dashed b-b line-lg pull-in"></div>
				<div class="form-group">
					<label class="col-sm-2 control-label">所读专业</label>
					<div class="col-sm-10">
						<input type="text" class="form-control" placeholder="请输入咨询者所读专业" name="major" value="{$consultant.major}">
					</div>
				</div>
				<div class="line line-dashed b-b line-lg pull-in"></div>
				<div class="form-group" style="margin-bottom: 40px;">
					<div class="col-sm-5 col-sm-offset-2">
						<a href="{:url('consultant_module/index/show_list')}" class="btn btn-default">返回</a>
						<button style="margin-left: 10px;" type="submit" class="btn btn-primary">保存</button>
					</div>
				</div>
			</form>
		</div>
	</section>
</section>
<script>
	$("#file").on("change", function(evt) {
		var files = evt.target.files; // 获得文件对象 
		var res = validate_img(files);
		if(res.status) {
			uploadFile("file", "{:url('common/base/upload_image')}");
		} else {
			crm.alert(res.msg, "error");
			$("#file").val("");
		}
	})
</script>
